home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Net / Utilities / Seer family 2.0 / docs / unloved files / packet_format.p < prev    next >
Encoding:
Text File  |  1987-08-29  |  2.0 KB  |  75 lines  |  [TEXT/KAHL]

  1. UNIT packet_format;
  2. INTERFACE
  3. type
  4.  
  5.     pf_byte=0..255;        {packs to one byte}
  6.     pf_word=0..$ffff;    {packs to a word}
  7.  
  8.     { define a ddp short header}
  9.     pf_DDP_short=packed record
  10.     al_dest:pf_byte;    {lap destination}
  11.     al_src:pf_byte;    {lap source}
  12.     al_type:pf_byte; {lap type}
  13.     len_flags:pf_word;    {length and flags, use pf_lf_decode to unpack}
  14.     dst_sok:pf_byte;    {DDP destination socket}
  15.     src_sok:pf_byte;    {DDP source socket}
  16.     ty:pf_byte;    {DDP proticol type}
  17.     end;
  18.     pf_DDP_short_pt=^pf_DDP_short;
  19.  
  20.     { define a ddp long header}
  21.     pf_DDP_long=packed record
  22.     al_dest:pf_byte;    {lap destination}
  23.     al_src:pf_byte;    {lap source}
  24.     al_type:pf_byte; {lap type}
  25.     len_flags:pf_word;    {length and flags, use pf_lf_decode to unpack}
  26.       cks:pf_word;        {network checksum}
  27.        dst_net:pf_word;    {destination network}
  28.       src_net:pf_word;    {source network}
  29.       dst_nod:pf_byte;    {destination node id}
  30.       src_nod:pf_byte;    {source node id}
  31.     dst_sok:pf_byte;    {DDP destination socket}
  32.     src_sok:pf_byte;    {DDP source socket}
  33.     ty:pf_byte;    {DDP proticol type}
  34.     end;
  35.     pf_DDP_long_pt=^pf_DDP_long;
  36.  
  37.     pf_ddp_types=(pf_ddp_is_short,pf_ddp_is_long);
  38.     
  39.     {how to read a packet header, it may be just lap}
  40.     {or lap and long or short ddp.}
  41.     {since lap headers are an odd length they are duplicated}
  42.     {at the front of each ddp so that they pack correctly}
  43.     pf_some_ddp=packed record
  44.     case pf_ddp_types of
  45.         pf_ddp_is_short:(sddp:pf_DDP_short);
  46.         pf_ddp_is_long:(lddp:pf_DDP_long);
  47.     end;
  48.  
  49.     {decode the length/reserved bytes of a short ddp packet}
  50.     procedure pf_lf_short_decode(
  51.         pakwrd:pf_word;    {the length/reserved word to unpack}
  52.         var zro:pf_byte; {the reserved zero field}
  53.         var len:bf_word; {the packet length)
  54.         );
  55.  
  56.     {decode the length/hop/reserved bytes of long ddp packet}
  57.     procedure pf_lf_long_decode(
  58.         pakwrd:pf_word;    {the length/reserved word to unpack}
  59.         var zro:pf_byte; {the reserved zero field}
  60.         var len:bf_word; {the packet length)
  61.         var hop:bf_byte;    {the packet hop count}
  62.         );
  63.  
  64. IMPLEMENTATION
  65.  
  66. procedure pf_lf_long_decode;
  67. begin
  68. end;
  69.  
  70. procedure pf_lf_short_decode;
  71. begin
  72. end;
  73.  
  74. END.
  75.